<!DOCTYPE html>
<html>
	 <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>网上祭奠</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="js/JBox/jBox.css" rel="stylesheet" />
	<link href="js/JBox/plugins/Notice/jBox.Notice.css"  rel="stylesheet"/>
	<link rel="stylesheet" href="css/index.css" />
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/draggabilly.pkgd.js"></script>
    <script type="text/javascript" src="js/jquery.mCustomScrollbar.js" ></script>
    <script type="text/javascript" src="js/jquery.mCustomScrollbar.concat.min.js" ></script>
    <script type="text/javascript" src="js/JBox/jBox.js" ></script>
    <script type="text/javascript" src="js/JBox/plugins/Notice/jBox.Notice.js" ></script>
    <script type="text/javascript" src="js/jquery.easing.1.3.js" ></script>
    <script type="text/javascript" src="js/move-top.js" ></script>
    <script type="text/javascript" src="js/jquery.cookie.js" ></script>
    <script type="text/javascript" src="js/md5.js" ></script>
    <script type="text/javascript">
    	var uid;    	
    	$(document).ready(function(){
    		
    	}); 
    	
    	function userLogin(){
    		var u=$.trim($("#Login-user").val());
    		var p=$.trim($("#Login-pwd").val());
    		if(u==""||u==null){
    			new jBox('Notice', {width: 180,height: 50,content: '请输入账号或手机号',autoClose: 2000,
				    color: 'black',animation: {open: 'slide',close: 'slide:top'}
				 });
    		}else if(p==""||p==null){
    			new jBox('Notice', {width: 150,height: 50,content: '请输入密码',autoClose: 2000,
				    color: 'black',animation: {open: 'slide',close: 'slide:top'}
				});
    	}else{
		        var pwd = $.md5("jia" + p + "PU");
				$.ajax({
					url: "/api/User/login?RegisterPhone="+u+"&Password="+pwd+"&Sign=9907e3fe633129ebee3d5497a1110429&Ts=1493969798",
					type: "GET",
					dataType: "json", 
					success: function (data) {	
						var dataObj=eval(data);
						var dataResult= dataObj.Result;
						if(dataResult=="0"){
							new jBox('Notice', {width: 180,height: 50,content: '用户或密码不正确!',autoClose: 2000,
							    color: 'black',animation: {open: 'slide',close: 'slide:top'}
							});
						}else{				
							var user=dataObj.Data.uid;
							var un=dataObj.Data.Realname;
							$.cookie("JP",user);
							$.cookie("JPN",un);
							window.location="Index.html";
						}
				    },
				    error:function(XMLHttpRequest,textStatus,errorThrown)
				    {
				      	console.log(errorThrown);
				    }
				});
    		}
    	}
    	
    	function crtTimeFtt(val, row) {
	    	if (val != null) {
	            var date = new Date(val);
	            return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate();
	        }
		}    	
    	
    </script>
  </head>
	<body   class="Login-bg">
		<div style="height: 30px;"></div>
		<div class="Login-logo-bg"></div>
		<div style="height:30px;"></div>
		<div class="Login-panel">
			<div class="Login-panel-content">
				<div style="height: 10px;"></div>
				<div class="Login-panel-content-user">
					<label>账号：</label>
					<input type="text" placeholder="请输入账号或手机号"  id="Login-user"/>
				</div>
				<div class="Login-panel-content-user">
					<label>密码：</label>
					<input type="password" placeholder="请输入密码" id="Login-pwd"/>
				</div>
				<div class="Login-panel-btn">
					<button class="Login-btn" onclick="userLogin()">登录</button>
				</div>
				<div class="Login-panel-check">
					<input type="checkbox"  />
					<label class="Login-panel-check-auto">自动登录</label>
					<label class="Login-panel-check-fpwd">忘记密码？</label>
				</div>
				<div class="Login-panel-quick">

				</div>
			</div>		
		<div class="Login-bottom">登录即代表你同意<span style="color: red;text-decoration: underline;">《认亲用户协议》</span></div>
		</div>
	</body>
</html>
